# NoEffectTransition - Simply change from screen1 to screen 2
# Copyright (C) 2007 Lauri Taimila
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2007, Lauri Taimila"
__author__ = "Lauri Taimila <lauri@taimila.com>"

import clutter
from frontend.gui.transitions.transition import Transition

class NoEffectTransition(Transition):
    """
    NoEffectTransition 
    
    This is the most simple transition. It simply changes view from screen 1
    to screen 2 without any special effects.
    """
    
    def forwardEffect(self, from_screen, to_screen):   
        """
        Change screen without effects. 'from_screen' is None when app starts up.
        @param from_screen: Screen object (Currently displayed screen)
        @param to_screen: Screen object (Screen that is displayed after transition)
        """
        if from_screen is not None:
            from_screen.get_group().hide()
        to_screen.get_group().show()
                
    def backwardEffect(self, from_screen, to_screen):
        """
        Change to the previous screen.
        @param from_screen: Screen object (Currently displayed screen)
        @param to_screen: Screen object (Screen that is displayed after transition)
        """
        if from_screen is not None:
            from_screen.get_group().hide()
            self.stage.remove(from_screen.get_group())
        to_screen.get_group().show()
        